<!DOCTYPE html>
<html>

<!-- Mirrored from www.zi-han.net/theme/hplus/table_jqgrid.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 20 Jan 2016 14:20:02 GMT -->

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>退货详情</title>

    <link href="css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
    <link href="css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
    <link href="css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
    <link href="css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="css/animate.min.css" rel="stylesheet">
    <link href="css/style.min862f.css?v=4.1.0" rel="stylesheet">
    <link href="css/timePicker.css" rel="stylesheet">
    <link href="css/newStyle.css" rel="stylesheet">
    <!--图片插件-->
	<link href="js/plugins/fancybox/jquery.fancybox.css" rel="stylesheet">

    <style>
        /* 重写bookstrap样式表 勿删 */
        .form_inputs {
            width: 160px;
            background-color: #ebebeb;
            border: 1px solid #06a3f9;
            border-radius: 20px;
            -webkit-border-radius: 20px;
            -moz-border-radius: 20px;
            -o-border-radius: 20px;
            -ms-border-radius: 20px;
        }

        .ibox-title {
            padding: 20px;
        }

        .mb30 {
            margin-bottom: 20px;
        }

        /* 重写bookstrap样式表 勿删 */
        .ui-jqdialog {
            height: auto !important;
        }

        .ui-common-table tbody {
            background-color: #eaf5fc !important;
        }

        .modal-dialog {
            margin: 80px auto !important;
        }

        .form-group {
            margin-left: 0px !important;
            margin-right: 0px !important;
        }

        .modal-sm {
            width: 600px;
        }

        .col-sm-3 {
            width: 30%;
        }

        .col-sm-8 {
            width: 70%;
        }

        .form-horizontal .control-label {
            text-align: left;
            padding-top: 5px;
            font-size: 18px;
        }

        @media only screen and (min-width: 100px) and (max-width: 600px) {
            .modal-sm {
                width: 400px;
            }

            .col-sm-3 {
                width: 40%;
            }

            .col-sm-8 {
                width: 60%;
            }

            .scroll_div {
                width: 85%;
            }

            .form-horizontal .control-label {
                text-align: left;
                padding-top: 5px;
                font-size: 14px;
            }

            .dialog_btn {
                font-size: 14px !important;
            }
        }

        @media only screen and (min-width: 650px) {
            .modal-sm {
                width: 600px;
            }
        }

        /*以下是等待状态的通用样式*/
        .wating_big_div {
            position: fixed;
            top: 0px;
            width: 100%;
            height: 100%;
            display: table;
            z-index: 9999;
        }

        .zhezhao {
            opacity: 0.3;
            position: absolute;
            top: 0px;
            width: 100%;
            height: 100%;
            z-index: 9999;
        }

        .wating_content_div {
            text-align: center;
            background: none;
            display: table-cell;
            vertical-align: middle;
        }

        /*以上是等待状态的通用样式*/
        .inputcherckStyle {
            width: 18px;
            height: 18px;
            -webkit-appearance: none;
            -moz-appearance: none;
            appearance: none;
            background: url("")
        }

        .inputcherckStyle:hover {
            background: url("")
        }

        .inputcherckStyle:checked {
            background: url("")
        }

        #timebox {
            width: 50%;
            height: 100%;
            /* display: flex;
        align-items: center; */
        }

        #timebox>span {
            width: 4.16%;
            display: block;
            float: left;
        }

        .order_choose {
            padding: 5px 10px;
            margin: 5px;
            font-size: 14px;
            margin-right: 10px;
            margin-top: 8px;
            border: 1px solid #ccc;
            text-align: center;
            cursor: pointer;
        }
       
        .coupon_content{
            width: 95%;
            margin: 0 auto;
            overflow: hidden;
        }
        .coupon_content_box{
            background: #fff;
        }
        .coupon_content_pading{
            width: 95%;
            margin: 0 auto;
            overflow: hidden;
        }
        .coupon_title{
            width: 100%;
            background: #f4f4f4;
        }
        .coupon_title_box{
            display: flex;
            justify-content: space-between;
            padding: 20px 0;
            align-items: center;
        }
        .coupon_title_box i{
            font-size: 16px;
            color:red;
        }
        .coupon_title_left span{
            font-size: 15px;
            color: red;
        }
        .coupon_title_right{
            width: 80px;
            height: 35px;
            border: 1px solid #999999;
            line-height: 35px;
            text-align: center;
            cursor: pointer;
        }
        .coupon_info{
            width: 100%;
            margin: 20px 0 10px;
            font-size: 16px;
        }
        .coupon_content_info{
            width: 100%;
            margin-bottom: 40px;
        }
        .coupon_content_kaiguan{
            width: 100%;
            display: none;
        }
        .coupon_content_button{
            width: 100%;
            margin: 50px 0px;
            display: flex;
            justify-content: center;
        }
        .coupon_content_bton{
            width: 180px;
            height: 45px;
            border-radius: 4px;
            background-color: #fff;
            color: rgba(26, 188, 156, 1);
            border: 1px solid rgba(26, 188, 156, 1);
            cursor: pointer;
            text-align: center;
            line-height: 45px;
        }
        .coupon_content_btoff{
            border: none;
            cursor: pointer;
            margin: 0 50px;
            width: 180px;
            height: 45px;
            border-radius: 4px;
            background-color: rgba(26, 188, 156, 1);
            color: #fff;
            text-align: center;
            line-height: 45px;
        }
        .videosList{
            width: 140px!important;
            height: 80px!important;
        }
        .coupon_table_footer{
            width: 100%;
        }
      
        .coupon_table_fbox{
            width: 100%;
            height: 47px;
            line-height: 47px;
            text-align: right;
            background: #eaf5fc;
            border-bottom: 1px solid #e7eaec;
            border-right: 1px solid #e7eaec;
            border-left: 1px solid #e7eaec;
        }
        .coupon_table_fbox span{
            color: red;
            margin-right: 20px;
        }
        .coupon_table_info tr th:nth-child(1){
            width: 20%;
        }
        .coupon_table_info tr th:nth-child(2){
            background: #fff;
            text-align: left;
        }
        .coupon_table_form tr th:nth-child(1){
            width: 20%;
        }
        .coupon_table_form tr th:nth-child(2){
            background: #fff;
            text-align: left;
        }
        #check_div select{
            width: 140px;
        }
        #freight_price label{
            line-height: 30px;
            height: 30px;
            overflow: hidden;
        }
        #freight_price input{
            margin-top: 10px;
        }
        .beizua, .beizub{
            display: none
        }
    </style>
</head>

<body class="gray-bg">
    <div class="wrapper wrapper-content  animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox ">
                    <div class="ibox-title pull-left w100p" style="padding: 10px 20px;border-bottom: 1px solid #e4e4e4;">
                        <div class="pull-left">
                            <div class="ibox-tools cache5">
                                退款详情
                            </div>
                        </div>

                        <div class="pull-right">
                            <button class="refresh_btn">
                                <a class="refresh_a">
                                    <i class="glyphicon glyphicon-chevron-left"></i> 返回
                                </a>
                            </button>
                        </div>
                    </div>
                    <div>
                        <div class="coupon_title">
                            <div class="coupon_content">
                                <div class="coupon_title_box">
                                    <div class="coupon_title_left">
                                        <i class="layui-icon layui-icon-tips"></i>
                                        <span>退款状态：</span>
                                        <span class="noStates"></span>
                                    </div>
                                    <!-- <div class="coupon_title_right">备注订单</div> -->
                                </div>
                            </div>
                        </div>
                        <div class="coupon_content_box">
                            <div class="coupon_content_pading">
                                <div class="coupon_content_info">
                                    <div class="coupon_info">
                                        <i class="glyphicon glyphicon-th-list"></i>
                                        <span>服务单信息</span>
                                    </div>
                                    <div class="coupon_table_info">
                                        <div class="flexw100">
                                            <table class="table table-bordered mb0">
                                                <thead>
                                                    <tr>
                                                        <th class="thl">服务单号</th><th class="thr" id="order_server"></th>
                                                    </tr>
                                                    <tr>
                                                        <th class="thl">申请状态</th><th class="thr" id="order_states"></th>
                                                    </tr>
                                                    <tr>
                                                        <th class="thl">订单编号</th><th class="thr" id="order_serial"></th>
                                                    </tr>
                                                    <tr>
                                                        <th class="thl">申请时间</th><th class="thr" id="order_time"></th>
                                                    </tr>
                                                    <tr>
                                                        <th class="thl">用户账号</th><th class="thr" id="order_account"></th>
                                                    </tr>
                                                </thead>
                                            </table>
                                        </div>
                                    </div>

                                    <div class="coupon_table_form">
                                        <div class="flexw100">
                                            <table class="table table-bordered mb0" >
                                                <thead>
                                                    <tr>
                                                        <th class="thl">订单金额</th><th class="thr" id="goods_name"></th>
                                                    </tr>
                                                    <!-- <tr>
                                                        <th class="thl">确认退款金额</th>
                                                        <th class="thr" id="freight_many"></th>
                                                    </tr> -->
                                                    <tr>
                                                        <th class="thl">退款方式</th><th class="thr" id="freight_address"></th>
                                                    </tr>
                                                    <tr>
                                                        <th class="thl">退款类型</th><th class="thr" id="freight_name"></th>
                                                    </tr>
                                                    <tr>
                                                        <th class="thl">退款原因</th><th class="thr" id="freight_detail"></th>
                                                    </tr>
                                                    <tr class="beizua">
                                                        <th class="thl">处理备注</th>
                                                        <th class="thr" id="freight_note">
                                                            <input name="freightNote" type="text">
                                                        </th>
                                                    </tr>
                                                    <tr class="beizub">
                                                        <th class="thl">处理备注</th>
                                                        <th class="thr" id="freight_notea">
                                                            
                                                        </th>
                                                    </tr>
                                                </thead>
                                            </table>
                                        </div>
                                    </div>
                                </div>
                                <div class="coupon_content_kaiguan">
                                    <div class="coupon_content_button">
                                        <div data-code="4" class="coupon_btn coupon_content_bton">拒绝</div>
                                        <div data-code="3" class="coupon_btn coupon_content_btoff">通过</div>
                                    </div>
                                </div>
                                
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script src="js/jquery-2.1.0.js" type="text/javascript" charset="utf-8"></script>
    <script src="js/bootstrap.min.js?v=3.3.6"></script>
    <script src="js/plugins/peity/jquery.peity.min.js"></script>
    <script src="js/content.min.js?v=1.0.0"></script>
    <script src="js/plugins/layer/laydate/laydate.js"></script>
    <script src="js/plugins/sweetalert/sweetalert.min.js"></script>
    <script src="js/plugins/fancybox/jquery.fancybox.js"></script>
    <script src="js/plugins/iCheck/icheck.min.js"></script>
    <script src="js/common.js" type="text/javascript" charset="utf-8"></script>
    <script src="js/jquery-timepicker.js" type="text/javascript" charset="utf-8"></script>
    <!--ajax上传插件:jquery.form ajaxSubmit-->
    <script src="js/jquery-form.js" type="text/javascript" charset="utf-8"></script>
    <script>
        var tableTimeout, limits = 10,
            page = 1,
            counts = 0,
            table_title, roleID;
        var cherk_roleId;
        var allMany = 0;
        var totalPages = 0;
        var maxIndex;
        var tableHtml;
        var userMessage;
        var order_serial;
        var order_phone;
        var applyDescribe,applyType,connectPhone,address,applyFailure,refundMethod
        var listId = getUrlParms('id')//上一页列表id
        var listCode = getUrlParms('code')//上一页列表订单号
        var listNumber = getUrlParms('number')//上一页
        var listPayType = getUrlParms('payType')//上一页
        var listPhone = getUrlParms('dataPhone')
        $(document).ready(function () {
            IsTokenSave();
            $(".fancybox").fancybox({openEffect:"none",closeEffect:"none"});
            userMessage = JSON.parse(sessionStorage.getItem("user_message"));
            $(".refresh_a").click(function () { //返回上一页
                // window.history.go(-1);
                window.location.href='./refund_goods.html?time='+new Date().getTime().toString()
            });
            $(".i-checks").iCheck({ //check必须有的脚本
                checkboxClass: "icheckbox_square-green",
                radioClass: "iradio_square-green",
            });

            var isbton = true
            $(".coupon_btn").click(function () { //提交
                if (isbton == false) {
                    return
                }
                isbton = false
                var moneyType = $(this).attr("data-code");
                applyFailure = $('input[name="freightNote"]').val()
            

                $.ajax({
                    type: "post",
                    url: urls + common_url.updateMoneyOrderYesOrNo,
                    async: true,
                    timeout: 30000,
                    dataType: "json",
                    headers: {
                        'X-Access-Token': userMessage.token,
                    },
                    data: {
                        sys_goods_num: listNumber,
                        order_serial_number: listCode,
                        pay_type: listPayType,
                        refundMethod: refundMethod,
                        applyDescribe: applyDescribe,
                        applyType: applyType,
                        applyFailure: applyFailure,
                        moneyType: moneyType,
                        order: order_serial,
                        phone: listPhone
                    },
                    success: function (json) {
                        isbton = true
                        CheckLogout(json); //检查是否登陆过期
                        if (json.code == 0) {
                            swal({
                                title: "操作成功",
                                text: "操作成功",
                                type: "success",
                            }, function () {
                                location.reload();
                            });
                            DealTable();
                        } else {
                            TipsAlert(json.code);
                        }
                        InitTime(tableTimeout);
                    },
                    error: function (xml, text, errorThrown) {
                        isbton = true
                        if (text == "timeout") {
                            TipsAlert("请求超时,请检查网络或着重新打开该页面.");
                        } else {
                            TipsAlert("请求数据失败,请联系后台技术人员");
                        }
                        InitTime(tableTimeout);
                    }

                });

                
            });

                        
            // InitTbodyList()
            getOederInfo()
            // getAddress(1, 1, '#check_div');
        });
      
                /**
         * 该方法用于获取省市区地址
         * @param {Number} parentId parentId是父级地区的id
         * @param {Number} which which是用于判断是哪个select 0是省 1是市 2是区
         * */
       
        function getOederInfo() {
            $.ajax({
                type: "get",
                url: urls + common_url.selectMoneyOrderList,
                async: false,
                timeout: 3000,
                dataType: 'json',
                headers: {
                    'X-Access-Token': userMessage.token,
                },
                data: {
                    id: listId
                },
                success: function (json) {
                    CheckLogout(json); //检查是否登陆过期
                    if (json.code == 0) {
                        if (json.data.status == 1) {
                            $('.noStates').html('审核中')
                            $('#order_states').html('审核中')
                            $('.beizua').show()
                            $('.coupon_content_kaiguan').show()
                            
                        } else if (json.data.status == 2) {
                            $('.noStates').html('取消退款')
                            $('#order_states').html('取消退款')

                        } else if (json.data.status == 3) {
                            $('.noStates').html('审核已通过')
                            $('#order_states').html('审核已通过')
                            $('.beizub').show()
                            $('#freight_notea').html(json.data.treatmentMemo)
                        } else if (json.data.status == 4) {
                            $('.beizub').show()
                            $('.noStates').html('申请失败')
                            $('#order_states').html('申请失败')
                            $('#freight_notea').html(json.data.treatmentMemo)

                        }

                        $('#order_server').html(json.data.money_back_num)
                        $('#order_serial').html(json.data.order_serial_number)
                        order_serial = json.data.order_serial_number
                        order_phone = json.data.phone
                        $('#order_time').html(json.data.create_time)
                        $('#order_account').html(json.data.phone)
                        $('#goods_name').html(json.data.sum_price)
                       
                        if (json.data.refundMethod == 1) {
                            $('#freight_address').html('支付宝')
                        } else if (json.data.refundMethod == 2) {
                            $('#freight_address').html('微信')
                        } else if (json.data.refundMethod == 3) {
                            $('#freight_address').html('保盾')
                        }

                        $('#freight_name').html(json.data.apply_type)
                        $('#freight_detail').html(json.data.apply_describe) // 原因
                        

                        refundMethod = json.data.refundMethod
                        applyDescribe = json.data.apply_describe
                        applyType = json.data.apply_type
                       
                    } else {
                        TipsAlert(json.return_msg);
                    }
                },
                error: function (xml, text, e) {
                    if (text == "timeout") {
                        alert("请求超时,请重试")
                    } else {
                        alert("请求失败,请检查网络")
                    }
                }

            });


        }

        /**
         * 该方法用于初始化列表
         * @param {Number} startIndex startIndex是数据起始下标
         * */
        function InitTbodyList(startIndex) {
            Showload("正在初始化列表......");
            tableTimeout = setInterval("Timeout(tableTimeout)", 1000);
            $.ajax({
                type: "get",
                url: urls + common_url.selectReturnedGoodsInfo,
                async: true,
                timeout: 30000,
                dataType: "json",
                headers: {
                    'X-Access-Token': userMessage.token,
                },
                data: {
                    id: listId
                },
                success: function (json) {
                    CheckLogout(json); //检查是否登陆过期
                    if (json.code == 0) {
                        var myData = json.data
                        for (var i = 0; i < myData.length; i++) {
                            allMany =floatAdd(allMany,myData[i]["sum_price"])
                            tableHtml = tableHtml + '<tr>'+
                                '<td><a class="fancybox" href="'+imgUrl + myData[i].url+'" title="功能图标"><img src="'+imgUrl +myData[i].url+'" width="60px" height="60px" class="layui-upload-img gw_previewImg"></a></td>' +
                                '<td class="c_1ABC9C">' + myData[i]["goods_name"] + '</td>' +
                                '<td><p>价格：'+myData[i]["price"]+'</p><p>货号：'+myData[i].sys_goods_num+'</p></td>' +
                                '<td><p>尺寸：'+myData[i]["goods_size"]+'</p><p>颜色：'+myData[i].goods_color+'</p></td>' +
                                '<td>' + myData[i]["order_sum_number"] + '</td>' +
                                '<td>' + myData[i]["sum_price"] + '</td>' +
                                '</tr>';
                        }
                        $("#tbody_list1").html(tableHtml);
                        $(".coupon_table_allmany").html(allMany);
                        DealTable();
                    } else {
                        TipsAlert(json.code);
                    }
                    InitTime(tableTimeout);
                },
                error: function (xml, text, errorThrown) {
                    if (text == "timeout") {
                        TipsAlert("请求超时,请检查网络或着重新打开该页面.");
                    } else {
                        TipsAlert("请求数据失败,请联系后台技术人员");
                    }
                    InitTime(tableTimeout);
                }

            });
        }
         //加法运算
        function floatAdd(arg1, arg2) {
            var r1, r2, m;
            try { r1 = arg1.toString().split(".")[1].length } catch (e) { r1 = 0 }
            try { r2 = arg2.toString().split(".")[1].length } catch (e) { r2 = 0 }
            m = Math.pow(10, Math.max(r1, r2));
            return (arg1 * m + arg2 * m) / m;
        }
    </script>
</body>

</html>